package com.hero.consumer.service;


import com.hero.common.UserEntity;
import com.hero.consumer.service.impl.UserFeignClientFallBack;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 调用  hero-eureka-provide  中注册的  login 方法
 */
@FeignClient(name = "hero-eureka-provide",fallback = UserFeignClientFallBack.class) // 调用客户端的目标，指定客户端的名字
public interface UserFeignClient {

    @RequestMapping( value = "/login",method = RequestMethod.GET)
    public String login(@RequestParam("count") int count);

    @RequestMapping( value = "/loginParam",method = RequestMethod.POST)
    public String loginParam(@RequestParam("userName") String userName, @RequestParam("password") String password) ;

    @RequestMapping( value = "/loginJson",method = RequestMethod.POST)
    public String loginJson(@RequestBody UserEntity userInfo);
}
